package loan.calc.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import loan.calc.constant.dict.*;
import lombok.Data;
import lombok.EqualsAndHashCode;


import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "loan", autoResultMap = true)
@Schema(description = "借据实体", name = "LoanDO", title = "借据")
public class LoanDO extends BaseEntity implements Serializable {
    /**
     * 唯一编号
     */
    @TableId
    @Schema(description = "借据编号")
    private Long loanId;

    /**
     * 币种
     */
    @Schema(description = "币种")
    private CurrencyDictEnum currency;

    /**
     * 贷款金额
     */
    @Schema(description = "贷款金额")
    private BigDecimal applyAmount;

    /**
     * 起始日
     * 发放日
     */
    @Schema(description = "起始日/发放日")
    private LocalDate startDate;

    /**
     * 贷款到期日
     */
    @Schema(description = "到期日")
    private LocalDate maturityDate;

    /**
     * 贷款原始到期日
     */
    @Schema(description = "原始到期日")
    private LocalDate originalMaturityDate;

    /**
     * 还款方式
     */
    @Schema(description = "还款方式")
    private RepayMethodDictEnum repayMethod;

    /**
     * 是否计收复利
     */
    @Schema(description = "是否计收复利")
    private YNEnum chargeInterestPenalty;

    /**
     * 锁定状态
     */
    @Schema(description = "锁定状态")
    private LockStatusEnum lockStatus;

    /**
     * 宽限期天数
     */
    @Schema(description = "宽限期天数")
    private Integer graceDays;

    /**
     * 贷款处理日期
     */
    @Schema(description = "贷款处理日期")
    private LocalDate businessDate;

    /**
     * 结清日期
     */
    @Schema(description = "结清日期")
    private LocalDate finishDate;

    /**
     * 贷款状态
     */
    @Schema(description = "贷款状态")
    private LoanStatusEnum loanStatus;

    /**
     * 核销状态
     */
    @Schema(description = "核销状态")
    private WriteOffStatusEnum writeoffStatus;

    /**
     * 计息状态
     */
    @Schema(description = "计息状态")
    private InterestAccrualStatusEnum interestAccrualStatus;

    /**
     * 逾期天数
     */
    @Schema(description = "逾期天数")
    private Integer overdueDays;

    /**
     * 历史最高逾期天数
     */
    @Schema(description = "历史最高逾期天数")
    private Integer maxOverdueDays;

    /**
     * 系统五级分类
     */
    @Schema(description = "系统五级分类")
    private String classifyResult;

    /**
     * 人工五级分类
     */
    @Schema(description = "人工五级分类")
    private String manualClassifyResult;

    /**
     * 正常本金余额
     */
    @Schema(description = "正常本金余额")
    private BigDecimal normalPrincipalBalance;

    /**
     * 逾期本金余额
     */
    @Schema(description = "逾期本金余额")
    private BigDecimal overduePrincipalBalance;

    /**
     * 逾期利息余额
     */
    @Schema(description = "逾期利息余额")
    private BigDecimal overdueInterestBalance;

    /**
     * 计提利息余额
     */
    @Schema(description = "计提利息余额")
    private BigDecimal accruedInterestBalance;

    /**
     * 本金罚息余额
     */
    @Schema(description = "本金罚息余额")
    private BigDecimal principalPenaltyBalance;

    /**
     * 利息罚息余额
     */
    @Schema(description = "利息罚息余额")
    private BigDecimal interestPenaltyBalance;

    /**
     * 挂息余额
     */
    @Schema(description = "挂息余额")
    private BigDecimal suspenseInterestBalance;

}
